﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UTSDAL.LINQSQL.Model;

namespace UTSDAL.LINQSQL.DAO
{
    public class TimetableEventTypeDAO:GenericDAO<TimetableEventType,Guid>
    {
        public TimetableEventType getReservationEventType()
        {
            var reservationEventType = from eventType in base.Context.TimetableEventTypes
                                       where eventType.TimetableEventTypeName.Equals("Reservation")
                                       select eventType;

            return reservationEventType.SingleOrDefault<TimetableEventType>();
        }


        public TimetableEventType getGenerationEyentType()
        {
            var reservationEventType = from eventType in base.Context.TimetableEventTypes
                                       where eventType.TimetableEventTypeName.Equals("Generated")
                                       select eventType;

            return reservationEventType.SingleOrDefault<TimetableEventType>();
        }

        public TimetableEventType getScheduledEventType()
        {
            var eventTypeVar = from eventType in base.Context.TimetableEventTypes
                            where eventType.TimetableEventTypeName.Equals("Scheduled")
                            select eventType;

            return eventTypeVar.SingleOrDefault<TimetableEventType>();
        }

    }
}
